/**
 *  OptGeneralPg.cpp
 *
 *  Copyright (C) 2008  David Andrs <pda@jasnapaka.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "StdAfx.h"
#include "mLasq.h"
#include "OptGeneralPg.h"
#include "Config.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COptGeneralPg property page

IMPLEMENT_DYNCREATE(COptGeneralPg, CCePropertyPage)

COptGeneralPg::COptGeneralPg() : CCePropertyPage(COptGeneralPg::IDD)
{
	//{{AFX_DATA_INIT(COptGeneralPg)
	m_strPassword = Config.Password;
	m_strUserName = Config.UserName;
	m_bAutoConnect = Config.AutoConnect;
	//}}AFX_DATA_INIT
}

COptGeneralPg::~COptGeneralPg()
{
}

void COptGeneralPg::DoDataExchange(CDataExchange* pDX)
{
	CCePropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(COptGeneralPg)
	DDX_Control(pDX, IDC_AUTH_LBL, m_lblAuth);
	DDX_Text(pDX, IDC_PASSWORD, m_strPassword);
	DDX_Text(pDX, IDC_USERNAME, m_strUserName);
	DDX_Control(pDX, IDC_USERNAME, m_ctlUserName);
	DDX_Control(pDX, IDC_PASSWORD, m_ctlPassword);
	DDX_Check(pDX, IDC_AUTO_CONNECT, m_bAutoConnect);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(COptGeneralPg, CCePropertyPage)
	//{{AFX_MSG_MAP(COptGeneralPg)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COptGeneralPg message handlers

void COptGeneralPg::OnOK() {
	Config.UserName = m_strUserName;
	Config.Password = m_strPassword;
	Config.AutoConnect = m_bAutoConnect;

	CCePropertyPage::OnOK();
}
